import { Moon, Sun } from "lucide-react";
import useThemeStore from "../../store/theme";

export default function ThemeToggle() {
  const themeStore = useThemeStore();

  const toggleTheme = () => {
    themeStore.toggleTheme();
  };

  return (
    <button
      type="button"
      onClick={toggleTheme}
      className="btn btn-ghost btn-circle hover:bg-primary/10 transition-all duration-200 hover:scale-105"
      title={`Switch to ${themeStore.theme === "light" ? "dark" : "light"} theme`}
    >
      {themeStore.theme === "light" ? (
        <Moon className="h-5 w-5 text-base-content/80 hover:text-primary transition-colors duration-200" />
      ) : (
        <Sun className="h-5 w-5 text-base-content/80 hover:text-primary transition-colors duration-200" />
      )}
    </button>
  );
}
